const express = require('express')
const app = express()

const cors = require('cors')
app.use(cors())// 解决跨域

app.listen(8088, () => {
    console.log('服务启动')
})

app.get('/getName', (req, res) => {
    res.json({
        code: 200,
        data: {
            name: '张三'
        }
    })
})

app.get('/getTodoList', (req, res) => {
    res.json({
        code: 200,
        data: [
            {   
                date: '2022-08-01',
                title: '学习接口'
            },
            {   
                date: '2022-08-01',
                title: '吃冰糕'
            },
            {   
                date: '2022-08-01',
                title: '谈恋爱'
            }
        ]
    })
})

